/*******************************************************************************************************

Table A8: Difference-in-differences estimates with Tilly public protests as the outcome
variable

*******************************************************************************************************/


*Set directory path
cd "C:\Users\tsa23\Documents\petitions\replication files"


clear all

*read in our main dataset
use dta\didtilly1_rep.dta /// dataset with events with circle of same radius as the constituency


*Elminate contrituencies which are not part of Treatment G
drop if ID == 45 //University of Cambridge
drop if ID == 191 //University of Oxford
keep if new == 1 | drummond == .

gen treatgroup = 0
replace treatgroup =  1 if new==1 

gen treatinter = treatperiod*treatgroup

label var treatinter "T * A" 
label var treatgroup "T"
label var treatperiod "A"

gen logPNUM_all  = log(PNUM_all  + 1)
gen logPNUM_violent  = log(PNUM_violent  + 1)
gen logPNUM_peace  = log(PNUM_peace  + 1)

reg logPNUM_all  treatinter treatgroup treatperiod    , cl(ID)  
outreg2 treatinter treatgroup treatperiod     using results\tableA8, replace addt(Scale, 1, Outcome, log people, Treatment, G) asterisk(coef) auto(2) label ctitle(All) cttop(Treatment G) keep(treatinter treatgroup treatperiod    ) se  symbol(**,*,+) nocons

reg logPNUM_violent  treatinter treatgroup treatperiod    , cl(ID)  
outreg2 treatinter treatgroup treatperiod     using results\tableA8, append addt(Scale, 1, Outcome, log people, Treatment, G) asterisk(coef) auto(2) label ctitle(Violent) cttop(Treatment G) keep(treatinter treatgroup treatperiod    ) se  symbol(**,*,+) nocons

reg logPNUM_peace  treatinter treatgroup treatperiod    , cl(ID)  
outreg2 treatinter treatgroup treatperiod     using results\tableA8, append addt(Scale, 1, Outcome, log people, Treatment, G) asterisk(coef) auto(2) label ctitle(Peace) cttop(Treatment G) keep(treatinter treatgroup treatperiod    ) se  symbol(**,*,+) nocons

reg event_all  treatinter treatgroup treatperiod   , cl(ID)  
outreg2 treatinter treatgroup treatperiod    using results\tableA8, append addt(Scale, 1, Outcome, events, Treatment, G) asterisk(coef) auto(2) label ctitle(All) cttop(Treatment G) keep(treatinter treatgroup treatperiod   ) se  symbol(**,*,+) nocons

reg event_violent  treatinter treatgroup treatperiod   , cl(ID)  
outreg2 treatinter treatgroup treatperiod    using results\tableA8, append addt(Scale, 1, Outcome, events, Treatment, G) asterisk(coef) auto(2) label ctitle(Violent) cttop(Treatment G) keep(treatinter treatgroup treatperiod   ) se  symbol(**,*,+) nocons

reg event_peace  treatinter treatgroup treatperiod   , cl(ID)  
outreg2 treatinter treatgroup treatperiod    using results\tableA8, append addt(Scale, 1, Outcome, events, Treatment, G) asterisk(coef) auto(2) label ctitle(Peace) cttop(Treatment G) keep(treatinter treatgroup treatperiod   ) se  symbol(**,*,+) tex(frag) nocons



clear all

*read in our main dataset
use dta\didtilly2_rep.dta /// dataset with events with circle of twice the radius as the constituency


*Elminate contrituencies which are not part of Treatment L
drop if ID == 45 //University of Cambridge
drop if ID == 191 //University of Oxford
keep if sch_A==1 | sch_B == 1 | drummond!=.

gen treatgroup = 0
replace treatgroup =  1 if sch_A==1 

gen treatinter = treatperiod*treatgroup

label var treatinter "T * A" 
label var treatgroup "T"
label var treatperiod "A"


gen logPNUM_all  = log(PNUM_all  + 1)
gen logPNUM_peace  = log(PNUM_peace  + 1)

reg logPNUM_all  treatinter treatgroup treatperiod   , cl(ID)  
outreg2 treatinter treatgroup treatperiod     using results\tableA8, append addt(Scale, 2, Outcome, log people, Treatment, L) asterisk(coef) auto(2) label ctitle(All) cttop(Treatment L) keep(treatinter treatgroup treatperiod    ) se  symbol(**,*,+) nocons

reg logPNUM_peace  treatinter treatgroup treatperiod    , cl(ID)  
outreg2 treatinter treatgroup treatperiod     using results\tableA8, append addt(Scale, 2, Outcome, log people, Treatment, L) asterisk(coef) auto(2) label ctitle(Peace) cttop(Treatment L) keep(treatinter treatgroup treatperiod    ) se  symbol(**,*,+) nocons

reg event_all  treatinter treatgroup treatperiod   , cl(ID)  
outreg2 treatinter treatgroup treatperiod    using results\tableA8, append addt(Scale, 2, Outcome, events, Treatment, L) asterisk(coef) auto(2) label ctitle(All) cttop(Treatment L) keep(treatinter treatgroup treatperiod   ) se  symbol(**,*,+) nocons

reg event_peace  treatinter treatgroup treatperiod   , cl(ID)  
outreg2 treatinter treatgroup treatperiod    using results\tableA8, append addt(Scale, 2, Outcome, events, Treatment, L) asterisk(coef) auto(2) label ctitle(Peace) cttop(Treatment L) keep(treatinter treatgroup treatperiod   ) se  symbol(**,*,+) tex(frag) nocons

